package test;

import java.io.UnsupportedEncodingException;
import java.util.LinkedList;
import java.util.List;

public class Solution {
	//完全数  约数除去本身外相加为他本身  6 = 1+2+3
    public static void main(String[] args) {
//        int N = Integer.parseInt(args[0]);
        int N =100;
        int i, j, sum;
        String s ="";
        for (i = 1; i < N; i++) {
            sum = 0;
            for (j = 1; j <= i / 2; j++) {
                if (i % j == 0) {
                    sum += j;
                }
            }
            if (sum == i) {
               s=s+i+" ";
            }
        }
        System.out.println(s.trim());
    }
}

